<template>
  <div>
    <h1>我是子组件</h1>
    <slot name="header" v-bind:user="user">
      <h1>{{user.name}}</h1>
    </slot>
    <slot name="footer">
      <div>我是底部</div>
    </slot>
  </div>
</template>

<script >
export default {
  data(){
    return{
      user:{
        name:'小小',
        age:23
      }
    }
  },
  created() {
    console.log("插槽",this.$slots)
  }
}

</script>

<style scoped>

</style>
